package SV_XXE_SF;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;

import javax.xml.transform.Source;
import javax.xml.validation.SchemaFactory;

public class Fixed {
    public class Test {
        public void test(Source source) throws SAXException {
            SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");

            factory.setProperty("http://javax.xml.XMLConstants/property/accessExternalDTD", "");
            factory.setProperty("http://javax.xml.XMLConstants/property/accessExternalSchema", "");
            factory.setProperty("http://javax.xml.XMLConstants/property/accessExternalStylesheet", "");

            factory.newSchema(source);
        }
    }
}
